package com.yunji.generate.bean;

import java.io.Serializable;
import java.util.List;

/**
 * 数据表信息
 **/
public class TableInfo implements Serializable {

    /**
     * 支持 excel
     */
    private boolean isExcelSupported;

    /**
     * 支持 swagger
     */
    private boolean isSwaggerSupported;

    /**
     * 表名
     */
    private final String name;

    /**
     * 注释
     */
    private final String remarks;

    /**
     * 列信息
     */
    private List<ColumnInfo> columns;

    public TableInfo(String name, String remarks) {
        this.name = name.toUpperCase(); // 表名转大写
        this.remarks = remarks;
    }

    public String getName() {
        return name;
    }

    public List<ColumnInfo> getColumns() {
        return columns;
    }

    public void setColumns(List<ColumnInfo> columns) {
        this.columns = columns;
    }

    public String getRemarks() {
        return remarks;
    }

    public boolean isExcelSupported() {
        return isExcelSupported;
    }

    public void setExcelSupported(boolean excelSupported) {
        isExcelSupported = excelSupported;
    }

    public boolean isSwaggerSupported() {
        return isSwaggerSupported;
    }

    public void setSwaggerSupported(boolean swaggerSupported) {
        isSwaggerSupported = swaggerSupported;
    }

    @Override
    public String toString() {
        return "Table{" +
                "name='" + name + '\'' +
                ", remarks='" + remarks + '\'' +
                ", columns=" + columns +
                '}';
    }
}
